<template>
  <web-view :src="src" @message="handleMessage" v-if="src"></web-view>
</template>

<script>
import { baseURL } from '@/config/app.js'
export default {
  data() {
    return {
      src: '',
    };
  },
	onLoad() {
		const option = this.$Route.query
		this.src = decodeURIComponent(option?.url) || ''
	},
  methods: {
    handleMessage(e) {
      console.log('eeeee1', e);
			let data = e?.detail?.data || []
			if(data.length>0){
				if(data[0].type == 'locationConfirm'){
					let addressObj = data[0].payload
					uni.$emit('locationConfirm', addressObj);
					this.$Router.back(1)
				}else if(data[0].type == 'locationCancel'){
					this.$Router.back(1)
				}
			}
      if (e.detail.data[0] && e.detail.data[0].address) {
        
      }
    },
  },
};
</script>
